﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PControl
{
    public partial class TipButtonX : DevComponents.DotNetBar.ButtonX
    {
        private String tipText;

        [Description("get or set text would be shown on the button when the point of your mouse is hovering on it!\n获取或设置鼠标指针悬停在按钮上时要显示的文本")]
        [Category("TipButton")]
        [RefreshProperties(RefreshProperties.All)]
        public String TipText
        {
            get
            {
                return tipText;
            }
            set
            {
                if (value != null)
                {
                    if (value.Length < 1)
                    {
                        tipText = Text;
                    }
                    else
                    {
                        tipText = value;
                    }
                }
                else
                {
                    tipText = Text;
                }
            }
        }

        public TipButtonX()
        {
            InitializeComponent();
        }

        private void TipButtonX_MouseHover(object sender, EventArgs e)
        {
            toolTip1.SetToolTip(this, tipText);
        }
    }
}
